package com.zkthink.ceres.member.entity;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类 实名认证
 * </p>
 *
 * @author chenke
 * @since 2020-11-28
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_member_authentication")
@ApiModel(value = "MemberAuthentication", description = "实名认证")
@AllArgsConstructor
public class MemberAuthentication extends Entity<Long> {
    private static final long serialVersionUID = 1L;

    /**
     * 会员ID
     */
    @ApiModelProperty(value = "会员ID")
    @TableField("mid")
    @Excel(name = "会员ID")
    private Long mid;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    @Length(max = 100, message = "姓名长度不能超过100")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "姓名")
    private String name;

    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @Length(max = 18, message = "身份证号长度不能超过18")
    @TableField(value = "id_card", condition = LIKE)
    @Excel(name = "身份证号")
    private String idCard;

    /**
     * 审核状态0:未填写 1:正在审核 2:审核通过 3:审核未通过
     */
    @ApiModelProperty(value = "审核状态 0:重新填写 1:待审核 2:审核通过 3:审核未通过")
    @TableField("status")
    @Excel(name = "审核状态 0:重新填写 1:待审核 2:审核通过 3:审核未通过")
    private Integer status;

    @ApiModelProperty(value = "身份证图像正面id", required = true)
    @TableField("front_img_id")
    @Excel(name = "身份证图像正面id")
    @NotNull(message = "文件id不能为空")
    private Long frontImgId;

    @ApiModelProperty(value = "身份证图像反面id", required = true)
    @TableField("reverse_img_id")
    @Excel(name = "身份证图像反面id")
    @NotNull(message = "文件id不能为空")
    private Long reverseImgId;

    /**
     * 身份证图像正面文件访问链接
     */
    @ApiModelProperty(value = "身份证图像正面url访问链接")
    @Length(max = 255, message = "身份证图像正面url长度不能超过255")
    @TableField("front_img_url")
    private String frontImgUrl;

    /**
     * 身份证图像反面文件访问链接
     */
    @ApiModelProperty(value = "身份证图像反面url访问链接")
    @Length(max = 255, message = "身份证图像反面url长度不能超过255")
    @TableField("reverse_img_url")
    private String reverseImgUrl;

    /**
     * 审核批注
     */
    @ApiModelProperty(value = "审核批注")
    @Length(max = 255, message = "审核批注长度不能超过255")
    @TableField("remark")
    private String remark;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @NotNull(message = "逻辑删除 1-删除 0-未删除不能为空")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;

    @Builder
    public MemberAuthentication(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser, Integer isDelete, Long mid,
                                String name, String idCard, Integer status, String remark,
                                Long frontImgId, Long reverseImgId, String frontImgUrl, String reverseImgUrl) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.mid = mid;
        this.name = name;
        this.idCard = idCard;
        this.status = status;
        this.frontImgId = frontImgId;
        this.reverseImgId = reverseImgId;
        this.frontImgUrl = frontImgUrl;
        this.reverseImgUrl = reverseImgUrl;
        this.remark = remark;
        this.isDelete = isDelete;
    }

}
